<?php
class Application_Model_Filter_JoblogSearch {
    
    /**
     * 开始时间
     */
    public $startTime;
    /**
     * 结束时间
     */
    public $endTime;
    /**
     * 任务Id
     */
    public $jobId;
    /**
     * 执行状态
     */
    public $status;
    /**
     * 执行编号
     */
    public $countTime;
    
    
    function getSearchFileds()
    {
        $where = array();
        $and = "";
        if($this->startTime != ""){
            $where[$and . " startTime >= "] = $this->startTime;
            $and = " and ";
        }
        if($this->endTime != ""){
            $where[$and . " startTime <= "] = $this->endTime." 23:59:59";
            $and = " and ";
        }
        
        if($this->jobId != ""){
            $where[$and." jobID = "] = $this->jobId;
            $and = " and ";
        }
        if($this->status != ""){
            $where[$and." status = "] = $this->status;
            $and = " and ";
        }
        if($this->countTime != ""){
            $where[$and." countTime = "] = $this->countTime;
            $and = " and ";
        }
        return $where;
    }
}
